<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>My Rentpad Account</title>
        <style>
            a {color:#404042;text-decoration:none;}      /* unvisited link */
            a:visited {color:#404042;}  /* visited link */
            a:hover {color:#404042;}  /* mouse over link */
            a:active {color:#404042;}  /* selected link */
        </style>
        <script type="text/javascript" src="js/jquery/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="js/token/jquery.tokeninput.js"></script>         
    </head>

    <body style="text-align: center; background-color: #FAFAFA; color: #404042; font-family: Century Gothic, Calibri, Verdana; padding: 0px; margin: 0px;">                

        <div style="margin-top: 0px; background-color: white;">

            <%@include file="header.jsp" %>

            <div style="width: 100%; text-align: left; font-family: Century Gothic, Calibri, Verdana; color: #404042; background-color: white; background: url('${model.props.appPath}/img/content-bg-short.jpg'); background-repeat: repeat-x; display: block; position: relative; top: -2px;">

                <div style="width: 1020px; margin-top: 10px; margin: 0 auto;">

                    <br>
                    <br>
                    <span style="font-size: 30px; font-weight: bold;">${model.user.firstName} ${model.user.lastName}</span>
                    
                    <br>
                    <br>  
                    <br>    
                    
                    <span style="font-size: 20px; font-weight: bold;">Contact Details</span>
                    <hr>

                    <table cellpadding="5" cellspacing="5">
                        <table>
                            <tr>
                                <td style="vertical-align: top;">
                                    <table cellpadding="5" cellspacing="5" >
                                        <tr><td>Email: ${model.user.emailPrimary}</td><td></td></tr>   
                                        <tr><td>Mobile: ${model.user.mobilePrimary}</td><td></td></tr>  
                                        <tr><td>Landline: ${model.user.landlinePrimary}</td><td></td></tr>                          
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </table>

                    <br><br>
                    <span style="font-size: 20px; font-weight: bold;">Listings</span>
                    <hr>
                    <br>

                    <table border="1" cellpadding="5" cellspacing="5" style="width:100%; border-collapse: collapse;">
                        <tr>
                            <th>Title</th>
                            <th>Posted on</th>
                            <th>Verified</th>
                            <th>Valid until</th>
                            <th colspan="3">Listing Actions</th>
                        </tr>
                        <c:forEach items="${model.listings}" var="listing">
                            <tr>
                                <td><a href="listing.htm?a=2&id=${listing.id}" style="color: #369;">${listing.title}</a></td>
                                <td align="center"><fmt:formatDate value="${listing.dateCreated}" pattern="MM/dd/yyyy" /></td>
                                <td align="center">
                                    <c:if test="${listing.verified}">
                                        yes
                                    </c:if>
                                    <c:if test="${!listing.verified}">
                                        no
                                    </c:if>
                                </td>
                                <td><fmt:formatDate value="${listing.expiryDate}" pattern="MM/dd/yyyy" /></td>
                                <td align="center">
                                    <a href="listing.htm?a=4&id=${listing.id}" style="color: #369;">Edit Info</a>
                                </td>
                                <td align="center">
                                    <a href="listing.htm?a=1003&id=${listing.id}" style="color: #369;">Edit Photos</a>
                                </td>
                                <td align="center">
                                    <a href="listing.htm?a=5&id=${listing.id}" style="color: #369;">Delete</a>
                                </td>
                            </tr>
                        </c:forEach>
                    </table>

                </div>

                <br><br>                

            </div>

            <div>
                <img src="${model.props.appPath}/img/footer-foot.jpg" style="border: 0px solid black; display: block; width: 100%;" />
            </div>

        </div>

    </body>
    
</html>
